package ooday09;

import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Scanner;

    public class MinToMax {
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入10个整数");
            int[] a = new int[10];
            int i;
            for (i = 0; i < 10; i++) {
                try{
                    a[i] = sc.nextInt();
                } catch (InputMismatchException e){
                    sc.nextLine();
                    i-=1;
                    System.out.println("输入的不是整数，重新输入");
                }

            }
            System.out.println("从小到大为：");
            Arrays.sort(a);
            for (int q = 0; q < 10; q++) {
                System.out.println(a[q]);
            }
        }
    }
